Skip to content

Make Babel an optional peer dependency#203

Open
LoganDark wants to merge 1 commit into
preactjs:mainfrom
LoganDark:optional-babel
Open

Make Babel an optional peer dependency#203
LoganDark wants to merge 1 commit into
preactjs:mainfrom
LoganDark:optional-babel

Conversation

@LoganDark
Copy link
Copy Markdown

@LoganDark LoganDark commented May 1, 2026

When combined with preactjs/prefresh#614, Babel is no longer in the dependency tree.

Copy link
Copy Markdown
Member

@rschristian rschristian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure that I love the idea of doing this outside a major, the majority of Vite users will likely experience a (minor) breakage with this as package managers will remove their required Babel deps.

There's a very WIP branch for a new major, I'm thinking it's better to roll this into that.

@LoganDark
Copy link
Copy Markdown
Author

package managers will remove their required Babel deps

Huh? Peer deps aren't automatically uninstalled by package managers...

@rschristian
Copy link
Copy Markdown
Member

rschristian commented May 19, 2026

Huh? Peer deps aren't automatically uninstalled by package managers...

If you go from dep -> optional peerDep, the pm can remove it, yes. It isn't guaranteed they'll keep around optional peer deps.

I would need to check latest versions as I don't know current behavior off the top of my head, but I know NPM used to consistently do that for sure.

@LoganDark
Copy link
Copy Markdown
Author

LoganDark commented May 19, 2026

Do we know if the majority of Vite users are still depending on Babel? Vite moved away from Babel with 8, didn't it?

@rschristian
Copy link
Copy Markdown
Member

rschristian commented May 19, 2026

Vite 8 just came out, there's always a long tail of users on older versions (and we support back to Vite 2). Only 18% of Vite users can actually forgo Babel.

Useful tool for comparing usage across major/minor versions

@LoganDark
Copy link
Copy Markdown
Author

Thank you, that's helpful context.

Are you talking about #174? I can retarget that branch if you'd prefer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants